package com.xb.p17_intentdata;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class Activity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_2);


        TextView hello=findViewById(R.id.hello);
        Bundle recv=this.getIntent().getExtras();

        String text1=recv.getString("text1");
        String text2=recv.getString("text2");

        hello.setText("hello,"+text1+","+text2);
    }

    public void back(View view){
        Intent intent=new Intent();
        intent.setClass(this,MainActivity.class);
        startActivity(intent);
    }

}